package org.ReportDesigner;

import org.ReportDesigner.configurator.Configuration;
import org.ReportDesigner.configurator.DefaultConfiguration;
import org.ReportDesigner.reportModel.ReportElement;
import org.ReportDesigner.designerPDF.PDFDesigner;
import org.ReportDesigner.designerXML.XMLDesigner;
import org.ReportDesigner.reportModel.Report;
import com.itextpdf.text.DocumentException;

import java.io.File;
import java.io.FileNotFoundException;


public class Some {

    public static void main(String[] args){
        XMLDesigner designer = new XMLDesigner();
        designer.setInputFile(new File("D:\\Intellij idea home\\org.ReportDesigner\\src\\main\\inputTestFile.xml"));
        ReportElement report = new Report();
        designer.design();
        report = designer.getReport();
        Configuration defConf = new DefaultConfiguration();
        defConf.createConfiguration();

        PDFDesigner pdfDesigner = new PDFDesigner(new File("D:\\Intellij idea home\\org.ReportDesigner\\src\\main\\inputTestFile.pdf"),
                report,defConf );
        pdfDesigner.setOutputFile(new File("D:\\Intellij idea home\\org.ReportDesigner\\src\\main\\inputTestFile.pdf"));
        pdfDesigner.setReport(report);
        try {
            pdfDesigner.design();
        } catch (FileNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (DocumentException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

    }
}
